
#include <AVUIGeometry.h>

namespace AVUI {
    
class EllipseGeometry : public Geometry
{
public:
    DECLARE_ELEMENT(EllipseGeometry, Geometry);

    EllipseGeometry() { };
    ~EllipseGeometry() { };

    DECLARE_DEPENDENCY_PROPERTY(RadiusX);
    float get_RadiusX() { return AVUI::UnboxValue<float>(GetValue(get_RadiusXProperty())); }
    void set_RadiusX(float value) { SetValue(get_RadiusXProperty(), AVUI::BoxValue(value)); } 

    DECLARE_DEPENDENCY_PROPERTY(RadiusY);
    float get_RadiusY() { return AVUI::UnboxValue<float>(GetValue(get_RadiusYProperty())); }
    void set_RadiusY(float value) { SetValue(get_RadiusYProperty(), AVUI::BoxValue(value)); } 

    DECLARE_DEPENDENCY_PROPERTY(Center);
    Point get_Center() { return AVUI::UnboxValue<Point>(GetValue(get_CenterProperty())); }
    void set_Center(const Point& value) { SetValue(get_CenterProperty(), AVUI::BoxValue(value)); } 

    static void BuildGeometryStatic(GeometryBuilder* pGeometryBuilder, float radiusX, float radiusY, const Point& center);

    virtual Rect GetBounds();
    virtual bool HitTest(const Point& pt, int hitTestFlags, float strokeThickness);

protected:

    virtual TRefCountedPtr<Freezable> CreateInstanceCore() AVUI_OVERRIDE { return object_allocate<EllipseGeometry>().get_Ptr(); }

private:
    static void StaticConstructor();
    virtual void BuildGeometry(GeometryBuilder* pGB);
};



}; // namespace AVUI
